<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:r="http://ricchieri.com/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
	<ui:composition template="../../templates/commonLayoutOther.xhtml">
		<ui:define name="title">#{msg.titleOther}</ui:define>
		<ui:define name="content">		
			<h:form id="addOperation">
			<h2>#{msg.addOperation}</h2>  	
			<r:viewUser manageBean="#{addOperationMB}" user="#{addOperationMB.user}"  showRoles="false" showEmail="false" showPhone="false"/>
			
			<h:panelGrid columns="3" style="margin-top:20px;">
				<h:outputLabel value="#{msg.operationType}"/>
	    		<p:selectOneMenu id="operationType" value="#{addOperationMB.operationType}">
	               <f:selectItems value="#{addOperationMB.operations}" />	               
	           </p:selectOneMenu> 
	           <p:message id="operationTypeMsg" for="operationType" display="icon"/>
			
				<h:outputLabel value="#{msg.amount}"/>
				<p:inputText id="amount" 
					value="#{addOperationMB.amount}" 
					onkeypress="return isDecimalNumberKey(event)"
					maxlength="7"/>
				<p:message for="amount" display="icon"/>
				
				<h:outputLabel value="#{msg.observation}"/>
				<p:inputTextarea rows="12" style="width:99%" id="observation" value="#{addOperationMB.observation}"					 
					required="true" requiredMessage="#{msg.requiredObservation}" 
					title="#{component.valid ? '' : addOperationMB.getErrorMessage(component.clientId)}"
					maxlength="500" autoResize="false"/>
				<p:message id="observationMsg" for="observation"/>
        	</h:panelGrid>			
        	<h:panelGrid columns="4" style="margin-top:10px; text-align:center">
        	    <p:commandButton id="searchOperation" value="#{msg.userAccountState}" action="#{addOperationMB.doBackToSearchOperation}" update="@form" process="@this" styleClass="button-action green"/>
        		<p:commandButton id="viewUserAccountState" value="#{msg.passengerData}" action="#{addOperationMB.doBackToViewUserAccountStatus}" update="@form" process="@this" styleClass="button-action green"/>
        		
		    	<p:commandButton id="reset" value="#{msg.resetButton}" action="#{addOperationMB.reset}" update="@form" process="@this" styleClass="button-action green"/>
		    	<p:commandButton id="addOperation" value="#{msg.saveButton}" action="#{addOperationMB.save}" ajax="false" styleClass="button-action green"/>
		    </h:panelGrid>
		    </h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>
